<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            padding: 0;
            margin: 0;
        }

        .w {
            /* 版心 */
            /* width: 1126px; */
            width: 1226px;
            margin: 0 auto;
        }

        .header {
            height: 200px;
            background: grey;
        }

        .wrap {
            height: 45px;
             /*
            了解 
            粘性定位:  吸顶效果的
                (1) 盒子顶部没有移出 窗口(包裹该盒子的父元素)之前,标准文档流,移出之后会变为固定定位
            */
            position:sticky;
            top: 0;
            left: 0;
        }

        .wrapNav {
            width: 100%;
            background-color: grey;
           
            
        }

        .nav {
            background: pink;
            height: 45px;
        }

        .banner {
            height: 300px;
            background-color: red;
        }

        .main .part {
            height: 400px;
            line-height: 400px;
            text-align: center;
            border: 1px solid #333;
        }

        .footer {
            height: 500px;
            background-color: grey;
        }

        .tips {
            width: 100%;
            line-height: 45px;
            text-align: center;
            background-color: rgba(125, 255, 255, 0.6);
            position: fixed;
            bottom: 0;
            left: 0;
            display: none;
        }

        .back {
            width: 50px;
            height: 50px;
            text-align: center;
            line-height: 50px;
            border: 1px solid #333;
            position: fixed;
            right: 10px;
            bottom: 10px;
            display: none;
            user-select: none;
        }
    </style>
</head>

<body>
    <!--  -->
    <div class="header w"></div>
    <div class="wrap">
        <div class="wrapNav">
            <div class="nav w">
                <!-- 锚链接 -->
                <a href="#live">直播</a>
                <a href="#ani">动画</a>
                <a href="#drama">番剧</a>
                <a href="#chAni">国漫</a>
                <a href="#music">音乐</a>
                <a href="#sports">运动</a>

                <!--  # 默认返回当前页面的顶部 -->
                <a href="#">返回顶部</a>

                <!-- a 默认跳转当前页  => 刷新页面 -->
                <a href="">刷新</a>
            </div>
        </div>
    </div>
    <div class="banner w">1111111111111111111</div>
    <div class="main w">
        <!-- 锚标记 -->
        <div id="live" class="part">直播</div>
        <div id="ani" class="part">动画</div>
        <div id="drama" class="part">番剧</div>
        <div id="chAni" class="part">国漫</div>
        <div id="music" class="part">音乐</div>
        <div id="sports" class="part">运动</div>
    </div>
    <div class="footer w"></div>
    <div class="tips">到达底部</div>
    <div class="back">top</div>
</body>

<script>
    // 1. 导航栏吸顶
    // 2. 判断页面是否到达底部   => 到达底部之后显示tips(0.5s后消失)
    // 3. 点击top回到顶部   => 滚动距离超出 1000之后显示


</script>

</html>